﻿Public Class DataArrivaledEventArgs
    Inherits System.ComponentModel.AsyncCompletedEventArgs

    Private m_BytesTransfer() As Byte
    ''' <summary>
    ''' 传输的字节流
    ''' </summary>
    Public Property BytesTransfer() As Byte()
        Get
            Return m_BytesTransfer
        End Get
        Set(ByVal value() As Byte)
            m_BytesTransfer = value
        End Set
    End Property

    Private m_ClientSocket As System.Net.Sockets.Socket
    Public Property ClientSocket() As System.Net.Sockets.Socket
        Get
            Return m_ClientSocket
        End Get
        Set(ByVal value As System.Net.Sockets.Socket)
            m_ClientSocket = value
        End Set
    End Property


    Public Sub New(ByVal [error] As Exception, ByVal cancelled As Boolean, ByVal userState As Object)
        MyBase.New([error], cancelled, userState)
    End Sub

    Public Sub New(ByVal bytesTransfer() As Byte, ByVal [error] As Exception, ByVal cancelled As Boolean, ByVal userState As Object)
        MyBase.New([error], cancelled, userState)
        Me.m_BytesTransfer = bytesTransfer
    End Sub

    Public Sub New(ByVal bytesTransfer() As Byte, ByVal clientSocket As System.Net.Sockets.Socket, ByVal [error] As Exception, ByVal cancelled As Boolean, ByVal userState As Object)
        MyBase.New([error], cancelled, userState)
        Me.m_BytesTransfer = bytesTransfer
        Me.m_ClientSocket = clientSocket
    End Sub
End Class
